<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
    <title>Document</title>
    <style></style>
</head>
<body>
    <div id="app">
        <!-- style的对象写法 -->
        <div :style="{color:'red',fontSize:'30px'}">test style1</div>
        <!-- 也可以把对象书写在data中，然后直接引用 -->
        <div :style="boxStyle">test style2</div>
    </div>
    <script>
       const vm = new Vue({
            el: "#app",
            data() {
                return {
                    boxStyle:{
                        color:"pink",
                        fontSize:"40px",
                        fontWeight:"bold"
                    }
                }
            },
       })
    </script>
</body>
</html>